<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
    <title>HTML编辑器</title>
  </head>
  <body >
    <script type="text/javascript">
    function output(){
      var c=document.getElementById("code").value;
      var i=document.getElementById("fra");
      i.srcdoc=c;
    }
    </script>
    <input type="button" value="提交代码" onclick="output()" 
    style="border:0px solid:#FFFFFF;background-color:#E9FF7E;width:150px;height:50px">
    <div>
      <!--输入代码-->
      <textarea wrap="logical" id="code" style="width:48%;height:60%;overflow-x:scroll;white-space:pre-wrap" >
      <html>
        <head>
          <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
          <title>untitled</title>
        </head>
        <body>
        </body>
      </html>
      </textarea>
      <iframe id="fra" style="width:48%;height:60%;
      right:7px;position:absolute" scrolling="true"><font color="#FF0000">您的浏览器不支持iframe标签所以无法使用</font></iframe>
    </div>
  </body>
</html>